<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <f:view beforePhase="#{tCubeManagerBean.initBillListForTCube}"></f:view>
    <h:head>
        <title>View All Bills to Stakeholders</title>
        <style type="text/css">
            .gritter-notice-wrapper {
                left:200px;
                top: 50px;
            }
        </style>
    </h:head>
    <h:body>
        <h:form id="formMain">
            <h1>MyPrimeFacesOrganizer - Powered by PrimeFaces 2.2.1</h1>
            <p:menubar autoSubmenuDisplay="true">
                <p:menuitem value="Home" url="index.xhtml" />
                <p:submenu label="TCube">
                    <p:menuitem value="View All Stakeholders" url="TCubeViewAllStakeholder.xhtml" />
                    <p:menuitem value="View All Bills to Stakeholders" url="TCubeViewAllBills.xhtml" />
                </p:submenu>
                <p:submenu label="Stakeholder Billing Management System">
                    <p:menuitem value="View all bills" url="StakeholderViewAllBills.xhtml" />
                </p:submenu>
            </p:menubar>
            <br/>

            <p:panel id ="viewAllBills" header="View All Bills To Stakeholders">
                <p:dataTable var="paymentManagement" value="#{tCubeManagerBean.paymentManagementList}" paginator="true"
                             rows="12" emptyMessage="No bill has been created">
                    
                    <p:column sortBy="#{paymentManagement.id}" filterBy="#{paymentManagement.id}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Bill ID" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.id}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.stakeholder.corpName}" filterBy="#{paymentManagement.stakeholder.corpName}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Company name" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.stakeholder.corpName}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.startDate}" filterBy="#{paymentManagement.startDate}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Start Date" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.startDate}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.endDate}" filterBy="#{paymentManagement.endDate}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="End Date" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.endDate}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.totalPaymentCurrent}" filterBy="#{paymentManagement.totalPaymentCurrent}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Amount Paid" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.totalPaymentCurrent}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.paymentReceived}" filterBy="#{paymentManagement.paymentReceived}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Amount Paid" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.paymentReceived}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.paymentLeft}" filterBy="#{paymentManagement.paymentLeft}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Amount Left" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.paymentLeft}" />
                    </p:column>
                    
                    <p:column sortBy="#{paymentManagement.dueDate}" filterBy="#{paymentManagement.dueDate}" filterMatchMode="contains">
                        <f:facet name="header">
                            <h:outputText value="Due Date" />
                        </f:facet>
                        <h:outputText value="#{paymentManagement.dueDate}" />
                    </p:column>
                </p:dataTable>
                
            </p:panel>
     
        </h:form>
    </h:body>
</html>